<template>
    <div>
      <h1>查询结果</h1>
      <el-button @click="cha()">cha</el-button>
      <table>
        <thead>
        <tr>
          <th>歌名</th>
          <th>歌手</th>
          <th>专辑</th>
          <th>类型</th>
        </tr>
        </thead>

        <tbody>
        <tr v-for="(arr,index) in music" :key="index">
          <td>{{arr.singName}}</td>
          <td>{{arr.singer}}</td>
          <td>{{arr.singAlbum}}</td>
          <td>{{arr.singType}}</td>
        </tr>
        </tbody>
      </table>
    </div>
</template>

<script>
import axios from "axios";
    export default {
        name: "UpdateSong",
      data(){
          return{
            music:[],
            isLogin:false
          }
      },
      created() {
        if (this.isLogin===false) {
          this.$message.error("修改歌曲页面权限不足，不能访问!");
          this.$router.replace("/Shuju");
        }
      },
      methods:{
          cha(){
            axios({
              methods: "get",
              url:"http://localhost:3000/find",
              params:[
                // singName:this.singName,
                // singer:this.singer,
                // singAlbum:"",
                // singType:""


              ]
            }).then((res)=>{
              this.music.push(res.data[0]);
            }).catch(err=>{
              console.log(err);
            })
          }


      }

    }
</script>

<style scoped>

</style>
